﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CinemaMaestro.WebApplication.Models
{
    public class CategoryViewModels
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public static implicit operator CategoryViewModels(Category category)
        {
            return new CategoryViewModels
            {
                Id = category.Id,
                Name = category.Name
            };
        }

        public static implicit operator Category(CategoryViewModels categoryVM)
        {
            return new Category
            {
                Id = categoryVM.Id,
                Name = categoryVM.Name
            };
        }
    }
}